import QtQuick 2.0
import QtWebKit 3.0

Item {
    id: customWebView
    property string url
    property var dynamicWebView

    /*
    WebView {
        anchors.fill: parent
        visible: true
        url: customWebView.url
    } */

    onVisibleChanged: {
        if( customWebView.visible ) {
            dynamicWebView = Qt.createQmlObject("import QtQuick 2.0; import QtWebKit 3.0; WebView {
        anchors.fill: parent
        visible: true
    }", customWebView, "dynamicWebView");
            dynamicWebView.url = customWebView.url;
        } else {
            if( dynamicWebView )
                dynamicWebView.destroy();
        }
    }
}
